package Solutions

func groupAnagrams(strs []string) [][]string {
    count:=[26]int{}
    mp:=make(map[[26]int][]string)
    for _,v:=range strs{
        for _,v1:=range v{
            count[v1-'a']++
        }
        if _,ok:=mp[count];ok{
            mp[count]=append(mp[count],v)
        }else{
            mp[count]=[]string{v}
        }
        for i:=0;i<26;i++{
           count[i]=0
        }
        
    }
    ans:=make([][]string,0,len(mp))
    for _,v:=range mp{
        ans=append(ans,v)
    }
    return ans
}